﻿using Abp.Application.Services.Dto;
using Abp.Auditing;
using Abp.Authorization.Users;
using ARchGL.Platform.Dto;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace ARchGL.Platform.Dtos
{
    /// <summary>
    /// 获取Token信息 InputModel
    /// </summary>
    public class GetTokenInput
    {
        private string userNameOrEmailAddress;
        /// <summary>
        /// 标识
        /// </summary>
        [Required]
        [MaxLength(AbpUserBase.MaxEmailAddressLength)]
        public string KeyId
        {
            get => userNameOrEmailAddress;
            set => userNameOrEmailAddress = value?.Replace("\t", "")?.Trim(); //有可能出现用户名包含 \t 的风险，但是实际操作中 \t 频率出现太高，所以选择剔除。;
        }

        /// <summary>
        /// 密钥
        /// </summary>
        [Required]
        [MaxLength(AbpUserBase.MaxAuthenticationSourceLength)]
        [DisableAuditing]
        public string Secret { get; set; }
    }
}
